import feedforward
import backprop
import feedforward
import math

layers = [2,2,2]
testnet = feedforward.generate_net(layers, lambda: 1.0)

print testnet

(out, pre_activ, post_activ) = feedforward.propagate([1.0,1.0], testnet)

print "----------------------------"

print out
print "-------------------------------"

print pre_activ
print post_activ
print "-------------------------------"

momentum = feedforward.generate_net(layers, lambda: 0.0)

print "computing"
for i in xrange(1000):
    backprop.backprop(testnet, [0 - out[0], 0- out[1]], pre_activ, post_activ, momentum)
    (out, pre_activ, post_activ) = feedforward.propagate([1.0,1.0], testnet)

print "----------------------------"

print out
print "-------------------------------"

print pre_activ
print post_activ
print "-------------------------------"

print testnet
